
'===============================================================================
'  Generated From - VbNet_SQL_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  **
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'MustInherit' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can Override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  Public Class YourObject
'    Inherits _YourObject
'
'  End Class
'
'===============================================================================

' Generated by MyGeneration Version # (1.3.0.3)

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections
Imports System.Collections.Specialized

Imports MyGeneration.dOOdads

NameSpace ClassSigeco

Public MustInherit Class _si_recibo
	Inherits SqlClientEntity

		Public Sub New() 
			Me.QuerySource = "si_recibo"
			Me.MappingName = "si_recibo"
		End Sub

	'=================================================================
	'  Public Overrides Sub AddNew()
	'=================================================================
	'
	'=================================================================
	Public Overrides Sub AddNew()
		MyBase.AddNew()
				
	End Sub
	
	Public Overrides Sub FlushData()
		Me._whereClause = nothing
		Me._aggregateClause = nothing		
		MyBase.FlushData()
	End Sub
	
		
	'=================================================================
	'  	Public Function LoadAll() As Boolean
	'=================================================================
	'  Loads all of the records in the database, and sets the currentRow to the first row
	'=================================================================
	Public Function LoadAll() As Boolean
	
		Dim parameters As ListDictionary = Nothing
		
		
    	Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_si_reciboLoadAll]", parameters)
		
	End Function

	'=================================================================
	' Public Overridable Function LoadByPrimaryKey()  As Boolean
	'=================================================================
	'  Loads a single row of via the primary key
	'=================================================================
        Public Overridable Function LoadByPrimaryKey(ByVal IdRecibo As Integer) As Boolean

            Dim parameters As ListDictionary = New ListDictionary()
            parameters.Add(_si_recibo.Parameters.IdRecibo, IdRecibo)


            Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_si_reciboLoadByPrimaryKey]", parameters)

        End Function

	#Region "Parameters"
	Protected class Parameters 
		
		Public Shared ReadOnly Property IdRecibo As SqlParameter
			Get
				Return New SqlParameter("@IdRecibo", SqlDbType.Int, 0)
			End Get
		End Property
		
		Public Shared ReadOnly Property IdCliente As SqlParameter
			Get
				Return New SqlParameter("@IdCliente", SqlDbType.Int, 0)
			End Get
		End Property
		
		Public Shared ReadOnly Property Fecha As SqlParameter
			Get
				Return New SqlParameter("@Fecha", SqlDbType.DateTime, 0)
			End Get
		End Property
		
		Public Shared ReadOnly Property NroComprobante As SqlParameter
			Get
				Return New SqlParameter("@NroComprobante", SqlDbType.NVarChar, 50)
			End Get
		End Property
		
		Public Shared ReadOnly Property Concepto As SqlParameter
			Get
				Return New SqlParameter("@Concepto", SqlDbType.NVarChar, 200)
			End Get
		End Property
		
		Public Shared ReadOnly Property Estado As SqlParameter
			Get
				Return New SqlParameter("@Estado", SqlDbType.NVarChar, 50)
			End Get
		End Property
		
		Public Shared ReadOnly Property ActualizadoPor As SqlParameter
			Get
				Return New SqlParameter("@ActualizadoPor", SqlDbType.Int, 0)
			End Get
		End Property
		
		Public Shared ReadOnly Property ActualizadoFecha As SqlParameter
			Get
				Return New SqlParameter("@ActualizadoFecha", SqlDbType.DateTime, 0)
			End Get
		End Property
		
	End Class
	#End Region	

	#Region "ColumnNames"
	Public class ColumnNames
		
        Public Const IdRecibo As String = "idRecibo"
        Public Const IdCliente As String = "idCliente"
        Public Const Fecha As String = "fecha"
        Public Const NroComprobante As String = "nroComprobante"
        Public Const Concepto As String = "concepto"
        Public Const Estado As String = "estado"
        Public Const ActualizadoPor As String = "actualizadoPor"
        Public Const ActualizadoFecha As String = "actualizadoFecha"

		Shared Public Function ToPropertyName(ByVal columnName As String) As String

			If ht Is Nothing Then
			
				ht = new Hashtable
				
				ht(IdRecibo) = _si_recibo.PropertyNames.IdRecibo
				ht(IdCliente) = _si_recibo.PropertyNames.IdCliente
				ht(Fecha) = _si_recibo.PropertyNames.Fecha
				ht(NroComprobante) = _si_recibo.PropertyNames.NroComprobante
				ht(Concepto) = _si_recibo.PropertyNames.Concepto
				ht(Estado) = _si_recibo.PropertyNames.Estado
				ht(ActualizadoPor) = _si_recibo.PropertyNames.ActualizadoPor
				ht(ActualizadoFecha) = _si_recibo.PropertyNames.ActualizadoFecha

			End If
			
			Return CType(ht(columnName), String)
			
		End Function
		
		Shared Private ht  As Hashtable = Nothing		 
	End Class
	#End Region	
	
	#Region "PropertyNames"
	Public class PropertyNames
		
        Public Const IdRecibo As String = "IdRecibo"
        Public Const IdCliente As String = "IdCliente"
        Public Const Fecha As String = "Fecha"
        Public Const NroComprobante As String = "NroComprobante"
        Public Const Concepto As String = "Concepto"
        Public Const Estado As String = "Estado"
        Public Const ActualizadoPor As String = "ActualizadoPor"
        Public Const ActualizadoFecha As String = "ActualizadoFecha"

		Shared Public Function ToColumnName(ByVal propertyName As String) As String

			If ht Is Nothing Then
			
				ht = new Hashtable
				
				ht(IdRecibo) = _si_recibo.ColumnNames.IdRecibo
				ht(IdCliente) = _si_recibo.ColumnNames.IdCliente
				ht(Fecha) = _si_recibo.ColumnNames.Fecha
				ht(NroComprobante) = _si_recibo.ColumnNames.NroComprobante
				ht(Concepto) = _si_recibo.ColumnNames.Concepto
				ht(Estado) = _si_recibo.ColumnNames.Estado
				ht(ActualizadoPor) = _si_recibo.ColumnNames.ActualizadoPor
				ht(ActualizadoFecha) = _si_recibo.ColumnNames.ActualizadoFecha

			End If
			
			Return CType(ht(propertyName), String)
			
		End Function
		
		Shared Private ht  As Hashtable = Nothing
		
	End Class
	#End Region	
	
	#Region "StringPropertyNames"
	Public class StringPropertyNames
		
        Public Const IdRecibo As String = "s_IdRecibo"
        Public Const IdCliente As String = "s_IdCliente"
        Public Const Fecha As String = "s_Fecha"
        Public Const NroComprobante As String = "s_NroComprobante"
        Public Const Concepto As String = "s_Concepto"
        Public Const Estado As String = "s_Estado"
        Public Const ActualizadoPor As String = "s_ActualizadoPor"
        Public Const ActualizadoFecha As String = "s_ActualizadoFecha"

	End Class
	#End Region		
	
	#Region "Properties" 
        Public Overridable Property IdRecibo() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdRecibo)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdRecibo, Value)
            End Set
        End Property

        Public Overridable Property IdCliente() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdCliente)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdCliente, Value)
            End Set
        End Property

        Public Overridable Property Fecha() As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.Fecha)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.Fecha, Value)
            End Set
        End Property

        Public Overridable Property NroComprobante() As String
            Get
                Return MyBase.Getstring(ColumnNames.NroComprobante)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.NroComprobante, Value)
            End Set
        End Property

        Public Overridable Property Concepto() As String
            Get
                Return MyBase.Getstring(ColumnNames.Concepto)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Concepto, Value)
            End Set
        End Property

        Public Overridable Property Estado() As String
            Get
                Return MyBase.Getstring(ColumnNames.Estado)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Estado, Value)
            End Set
        End Property

        Public Overridable Property ActualizadoPor() As Integer
            Get
                Return MyBase.Getint(ColumnNames.ActualizadoPor)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.ActualizadoPor, Value)
            End Set
        End Property

		Public Overridable Property ActualizadoFecha As DateTime
			Get
				Return MyBase.GetDateTime(ColumnNames.ActualizadoFecha)
			End Get
			Set(ByVal Value As DateTime)
				MyBase.SetDateTime(ColumnNames.ActualizadoFecha, Value)
			End Set
		End Property


	#End Region  
	
	#Region "String Properties" 

		Public Overridable Property s_IdRecibo As String
			Get
				If Me.IsColumnNull(ColumnNames.IdRecibo) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdRecibo)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdRecibo)
				Else
					Me.IdRecibo = MyBase.SetintAsString(ColumnNames.IdRecibo, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_IdCliente As String
			Get
				If Me.IsColumnNull(ColumnNames.IdCliente) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdCliente)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdCliente)
				Else
					Me.IdCliente = MyBase.SetintAsString(ColumnNames.IdCliente, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Fecha As String
			Get
				If Me.IsColumnNull(ColumnNames.Fecha) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.Fecha)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Fecha)
				Else
					Me.Fecha = MyBase.SetDateTimeAsString(ColumnNames.Fecha, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_NroComprobante As String
			Get
				If Me.IsColumnNull(ColumnNames.NroComprobante) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.NroComprobante)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.NroComprobante)
				Else
					Me.NroComprobante = MyBase.SetstringAsString(ColumnNames.NroComprobante, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Concepto As String
			Get
				If Me.IsColumnNull(ColumnNames.Concepto) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Concepto)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Concepto)
				Else
					Me.Concepto = MyBase.SetstringAsString(ColumnNames.Concepto, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Estado As String
			Get
				If Me.IsColumnNull(ColumnNames.Estado) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Estado)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Estado)
				Else
					Me.Estado = MyBase.SetstringAsString(ColumnNames.Estado, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_ActualizadoPor As String
			Get
				If Me.IsColumnNull(ColumnNames.ActualizadoPor) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.ActualizadoPor)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.ActualizadoPor)
				Else
					Me.ActualizadoPor = MyBase.SetintAsString(ColumnNames.ActualizadoPor, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_ActualizadoFecha As String
			Get
				If Me.IsColumnNull(ColumnNames.ActualizadoFecha) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.ActualizadoFecha)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.ActualizadoFecha)
				Else
					Me.ActualizadoFecha = MyBase.SetDateTimeAsString(ColumnNames.ActualizadoFecha, Value)
				End If
			End Set
		End Property


	#End Region  	

	#Region "Where Clause"
    Public Class WhereClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffWhereParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffWhereParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "TearOff's"
		Public class TearOffWhereParameter

			Public Sub New(ByVal clause As WhereClause)
				Me._clause = clause
			End Sub
		
	
			Public ReadOnly Property IdRecibo() As WhereParameter
				Get
					Dim where As WhereParameter = New WhereParameter(ColumnNames.IdRecibo, Parameters.IdRecibo)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property IdCliente() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.IdCliente, Parameters.IdCliente)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Fecha() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Fecha, Parameters.Fecha)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property NroComprobante() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.NroComprobante, Parameters.NroComprobante)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Concepto() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Concepto, Parameters.Concepto)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Estado() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Estado, Parameters.Estado)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property ActualizadoPor() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.ActualizadoPor, Parameters.ActualizadoPor)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property ActualizadoFecha() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.ActualizadoFecha, Parameters.ActualizadoFecha)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property


			Private _clause as WhereClause
		End Class
		#End Region	

		Public ReadOnly Property IdRecibo() As WhereParameter 
			Get
				If _IdRecibo_W Is Nothing Then
					_IdRecibo_W = TearOff.IdRecibo
				End If
				Return _IdRecibo_W
			End Get
		End Property

		Public ReadOnly Property IdCliente() As WhereParameter 
			Get
				If _IdCliente_W Is Nothing Then
					_IdCliente_W = TearOff.IdCliente
				End If
				Return _IdCliente_W
			End Get
		End Property

		Public ReadOnly Property Fecha() As WhereParameter 
			Get
				If _Fecha_W Is Nothing Then
					_Fecha_W = TearOff.Fecha
				End If
				Return _Fecha_W
			End Get
		End Property

		Public ReadOnly Property NroComprobante() As WhereParameter 
			Get
				If _NroComprobante_W Is Nothing Then
					_NroComprobante_W = TearOff.NroComprobante
				End If
				Return _NroComprobante_W
			End Get
		End Property

		Public ReadOnly Property Concepto() As WhereParameter 
			Get
				If _Concepto_W Is Nothing Then
					_Concepto_W = TearOff.Concepto
				End If
				Return _Concepto_W
			End Get
		End Property

		Public ReadOnly Property Estado() As WhereParameter 
			Get
				If _Estado_W Is Nothing Then
					_Estado_W = TearOff.Estado
				End If
				Return _Estado_W
			End Get
		End Property

		Public ReadOnly Property ActualizadoPor() As WhereParameter 
			Get
				If _ActualizadoPor_W Is Nothing Then
					_ActualizadoPor_W = TearOff.ActualizadoPor
				End If
				Return _ActualizadoPor_W
			End Get
		End Property

		Public ReadOnly Property ActualizadoFecha() As WhereParameter 
			Get
				If _ActualizadoFecha_W Is Nothing Then
					_ActualizadoFecha_W = TearOff.ActualizadoFecha
				End If
				Return _ActualizadoFecha_W
			End Get
		End Property

		Private _IdRecibo_W As WhereParameter = Nothing
		Private _IdCliente_W As WhereParameter = Nothing
		Private _Fecha_W As WhereParameter = Nothing
		Private _NroComprobante_W As WhereParameter = Nothing
		Private _Concepto_W As WhereParameter = Nothing
		Private _Estado_W As WhereParameter = Nothing
		Private _ActualizadoPor_W As WhereParameter = Nothing
		Private _ActualizadoFecha_W As WhereParameter = Nothing

			Public Sub WhereClauseReset()

			_IdRecibo_W = Nothing
			_IdCliente_W = Nothing
			_Fecha_W = Nothing
			_NroComprobante_W = Nothing
			_Concepto_W = Nothing
			_Estado_W = Nothing
			_ActualizadoPor_W = Nothing
			_ActualizadoFecha_W = Nothing
				Me._entity.Query.FlushWhereParameters()

			End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffWhereParameter
    End Class	

	Public ReadOnly Property Where() As WhereClause
		Get
			If _whereClause Is Nothing Then
				_whereClause = New WhereClause(Me)
			End If
	
			Return _whereClause
		End Get
	End Property
	
	Private _whereClause As WhereClause = Nothing	
#End Region	

#Region "Aggregate Clause"
    Public Class AggregateClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffAggregateParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffAggregateParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "AggregateParameter TearOff's"
		Public class TearOffAggregateParameter

			Public Sub New(ByVal clause As AggregateClause)
				Me._clause = clause
			End Sub
		
	
		Public ReadOnly Property IdRecibo() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdRecibo, Parameters.IdRecibo)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property IdCliente() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdCliente, Parameters.IdCliente)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Fecha() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Fecha, Parameters.Fecha)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property NroComprobante() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.NroComprobante, Parameters.NroComprobante)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Concepto() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Concepto, Parameters.Concepto)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Estado() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Estado, Parameters.Estado)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property ActualizadoPor() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.ActualizadoPor, Parameters.ActualizadoPor)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property ActualizadoFecha() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.ActualizadoFecha, Parameters.ActualizadoFecha)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property


			Private _clause as AggregateClause
		End Class
		#End Region	

		Public ReadOnly Property IdRecibo() As AggregateParameter 
			Get
				If _IdRecibo_W Is Nothing Then
					_IdRecibo_W = TearOff.IdRecibo
				End If
				Return _IdRecibo_W
			End Get
		End Property

		Public ReadOnly Property IdCliente() As AggregateParameter 
			Get
				If _IdCliente_W Is Nothing Then
					_IdCliente_W = TearOff.IdCliente
				End If
				Return _IdCliente_W
			End Get
		End Property

		Public ReadOnly Property Fecha() As AggregateParameter 
			Get
				If _Fecha_W Is Nothing Then
					_Fecha_W = TearOff.Fecha
				End If
				Return _Fecha_W
			End Get
		End Property

		Public ReadOnly Property NroComprobante() As AggregateParameter 
			Get
				If _NroComprobante_W Is Nothing Then
					_NroComprobante_W = TearOff.NroComprobante
				End If
				Return _NroComprobante_W
			End Get
		End Property

		Public ReadOnly Property Concepto() As AggregateParameter 
			Get
				If _Concepto_W Is Nothing Then
					_Concepto_W = TearOff.Concepto
				End If
				Return _Concepto_W
			End Get
		End Property

		Public ReadOnly Property Estado() As AggregateParameter 
			Get
				If _Estado_W Is Nothing Then
					_Estado_W = TearOff.Estado
				End If
				Return _Estado_W
			End Get
		End Property

		Public ReadOnly Property ActualizadoPor() As AggregateParameter 
			Get
				If _ActualizadoPor_W Is Nothing Then
					_ActualizadoPor_W = TearOff.ActualizadoPor
				End If
				Return _ActualizadoPor_W
			End Get
		End Property

		Public ReadOnly Property ActualizadoFecha() As AggregateParameter 
			Get
				If _ActualizadoFecha_W Is Nothing Then
					_ActualizadoFecha_W = TearOff.ActualizadoFecha
				End If
				Return _ActualizadoFecha_W
			End Get
		End Property

		Private _IdRecibo_W As AggregateParameter = Nothing
		Private _IdCliente_W As AggregateParameter = Nothing
		Private _Fecha_W As AggregateParameter = Nothing
		Private _NroComprobante_W As AggregateParameter = Nothing
		Private _Concepto_W As AggregateParameter = Nothing
		Private _Estado_W As AggregateParameter = Nothing
		Private _ActualizadoPor_W As AggregateParameter = Nothing
		Private _ActualizadoFecha_W As AggregateParameter = Nothing

		Public Sub AggregateClauseReset()

		_IdRecibo_W = Nothing
		_IdCliente_W = Nothing
		_Fecha_W = Nothing
		_NroComprobante_W = Nothing
		_Concepto_W = Nothing
		_Estado_W = Nothing
		_ActualizadoPor_W = Nothing
		_ActualizadoFecha_W = Nothing
			Me._entity.Query.FlushAggregateParameters()

		End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffAggregateParameter
    End Class	

	Public ReadOnly Property Aggregate() As AggregateClause
		Get
			If _aggregateClause Is Nothing Then
				_aggregateClause = New AggregateClause(Me)
			End If
	
			Return _aggregateClause
		End Get
	End Property
	
	Private _aggregateClause As AggregateClause = Nothing	
#End Region	

	Protected Overrides Function GetInsertCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_reciboInsert]" 
	    
		CreateParameters(cmd)
		
		Dim p As SqlParameter
		p = cmd.Parameters(Parameters.IdRecibo.ParameterName)
		p.Direction = ParameterDirection.Output
    
		Return cmd 

  	End Function
	
	Protected Overrides Function GetUpdateCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_reciboUpdate]" 
		
		CreateParameters(cmd) 
		    
		Return cmd
	
	End Function	
	
	Protected Overrides Function GetDeleteCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_reciboDelete]" 
		
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.IdRecibo)
		p.SourceColumn = ColumnNames.IdRecibo
		p.SourceVersion = DataRowVersion.Current

  
		Return cmd
	
	End Function	
	
	Private Sub CreateParameters(ByVal cmd As SqlCommand)
	
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.IdRecibo)
		p.SourceColumn = ColumnNames.IdRecibo
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.IdCliente)
		p.SourceColumn = ColumnNames.IdCliente
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Fecha)
		p.SourceColumn = ColumnNames.Fecha
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.NroComprobante)
		p.SourceColumn = ColumnNames.NroComprobante
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Concepto)
		p.SourceColumn = ColumnNames.Concepto
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Estado)
		p.SourceColumn = ColumnNames.Estado
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.ActualizadoPor)
		p.SourceColumn = ColumnNames.ActualizadoPor
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.ActualizadoFecha)
		p.SourceColumn = ColumnNames.ActualizadoFecha
		p.SourceVersion = DataRowVersion.Current


	End Sub	

End Class

End NameSpace

